Tips for Good Content Modeling

As you have seen, you can create rich content models using XML and DTD’s.  The DTD’s that we have created are pretty simple, but as you can imagine, they can get quite complex.  Some developers like to take a “less is more” approach to content modeling in XML, but the rule of thumb among the “gurus” is just the opposite.  The common statement is, “Always create the richest content model that you can.”  This may seem strange, but there are some good reasons why.

It is easier to remove than to add.

This is a truism in XML and data modeling in general.  It is always easier to remove things from a model than to add them later.  

You cannot account for everything.

Yes, you are a good developer.  It doesn’t matter.  There are going to be things that you forget, your subject matter experts forget (or don’t tell you), or data will become available that wasn’t before.  This being the case, never “paint yourself into a corner” when it comes to content modeling.  True, the true “open system” (or content model) is an unrealistic dream, but why make it more difficult an yourself?  Add everything that you can, and account for the fact that you are going to miss something anyway.

You are going to have to support it.

The reward for building a good content model for your documents is that they are eventually going to become legacy data.  Most developers cringe when they think of supporting something (even their own creations) years down the road.  If you do it right up front, it is going to save you a lot of time and headache later.  This is in line with the thought of creating the content model as rich as you can because it will be easier to deal with things that are already in the model than to try and add them later.

It’s small now, but it’s going to grow.

There is a rule in software and data storage.  If it starts out as a small system, it is going to grow and become mission critical.  We have all created that “stop-gap” application or database that was only supposed to last through a couple of weeks or months and it ended up becoming a workflow process for an entire department.  It happens.  Account for it.  Build the content model right and growth won’t be nearly as big an issue.